﻿using DevExpress.ExpressApp.DC;
using System.ComponentModel;
using System.Xml.Linq;

namespace EasyXaf.LowCode.WorkflowEditors.Models;

public interface IFlowObject : INotifyPropertyChanging, INotifyPropertyChanged
{
    string Id { get; }

    bool IsUpdateLocked { get; }

    ITypeInfo TypeInfo { get; }

    IEnumerable<ValidationResult> ValidationResults { get; }

    event EventHandler ObjectChanged;

    void OnCreated();

    void OnLoaded();

    void OnCloned();

    void BeginUpdate();

    void CancelUpdate();

    void EndUpdate();

    void RaiseObjectChanged();

    void RaisePropertyChanging(string propertyName);

    void RaisePropertyChanged(string propertyName);

    object GetMemberValue(IMemberInfo memberInfo);

    void SetMemberValue(IMemberInfo memberInfo, object value);

    void WriteStateToXml(XElement element);

    void ReadStateFromXml(XElement element);

    void WriteToXml(XElement element);

    void ReadFromXml(XElement element);

    string ToXml();

    IEnumerable<ValidationResult> Validate();
}
